﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;
using Class_KetNoi;


namespace GiaoDien
{
    public partial class frmMain : RibbonForm
    {
        public frmMain()
        {
            InitializeComponent();
            InitSkinGallery();
           

        }
        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }
        KetNoiCoSoDuLieu kn = new KetNoiCoSoDuLieu();
        private void frmMain_Load(object sender, EventArgs e)
        {
            panelControl2.Hide();
           // barButtonPhanQuyen.Enabled = false;
        }

        private void barButtonCapNhatNhanVien_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_NhanVien f = new uc_NhanVien();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonCapNhatHDong_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_HopDong f = new uc_HopDong();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonChuyenCTac_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChuyenCongTac f = new uc_ChuyenCongTac();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonPhongBan_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_PhongBan f = new uc_PhongBan();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonChucVu_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChucVu f = new uc_ChucVu();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonKhenThuong_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_KhenThuong f = new uc_KhenThuong();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonKyLuat_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_KyLuat f=new uc_KyLuat();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonThaiSan_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ThaiSan f = new uc_ThaiSan();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonDanToc_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_DanToc f = new uc_DanToc();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonTrinhDo_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TrinhDo f = new uc_TrinhDo();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonLuongNhanVien_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_LuongNhanVien f = new uc_LuongNhanVien();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarPhongBan_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietPhongBan f = new uc_ChiTietPhongBan();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarChucVu_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietChucVu f = new uc_ChiTietChucVu();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarNhanVien_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietsNhanVien f = new uc_ChiTietsNhanVien();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarChuyenCongTac_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietChuyenCongTac f = new uc_ChiTietChuyenCongTac();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarKhenThuong_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietKhenThuong f = new uc_ChiTietKhenThuong();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarKyLuat_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietKyLuat f = new uc_ChiTietKyLuat();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void navBarThaiSan_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ChiTietThaiSan f = new uc_ChiTietThaiSan();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void traCuuNhanVien_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TraCuuNhanVien f = new uc_TraCuuNhanVien();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void traCuuChuyenCongTac_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TraCuuChuyenCongTac f = new uc_TraCuuChuyenCongTac();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void traCuuPhongBan_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TraCuuPhongBan f = new uc_TraCuuPhongBan();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void traCuuKhenThuong_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TraCuuKhenThuong f = new uc_TraCuuKhenThuong();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void traCuuKyLuat_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TraCuuKyLuat f = new uc_TraCuuKyLuat();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void traCuuThaiSan_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_TraCuuThaiSan f = new uc_TraCuuThaiSan();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void iExit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn thoát chương trình không?", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                kn.disconnect();
                frmMain f = new frmMain();
                f.Close();
                System.Windows.Forms.Application.Exit();
            }
        }

        private void barButtonQuanTriNgDung_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_QuanTriNguoiDung f = new uc_QuanTriNguoiDung();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonDoiMatKhau_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_DoiMatKhau f = new uc_DoiMatKhau();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonPhanQuyen_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl1.Controls.Clear();
            uc_ThietLapPhanQuyen f = new uc_ThietLapPhanQuyen();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }

        private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
        {
            panelControl2.Show();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            panelControl2.Hide();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            panelControl1.Controls.Clear();
            XtraUserControl1 f = new XtraUserControl1();
            panelControl1.Controls.Add(f);
            f.Dock = DockStyle.Fill;
        }


    }
}